#ifndef bin_h
#define bin_h

// this header needs
#include "wchar.h"
#include "ascii.h"

// this is not an encoding but a "trick encoding"
// to be able to facilitate file operations 

#define OWL_MIN_BIN 0x00
#define OWL_MAX_BIN 0xFF
#define OWL_INV_BIN 0x100
#define OWL_INV_BIN_STR     "[INV_BIN_INT]"
#define OWL_INV_ENC_BIN_STR "[INV_ENC_BIN]"

// character constants (wchar.h)
owl_wchar OWL_BIN_NUM[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
                           'A', 'B', 'C', 'D', 'E', 'F',
                           'a', 'b', 'c', 'd', 'e', 'f',
                           '+', '-', '.', 'X', 'x'};
owl_wchar OWL_BIN_WSP[] = {'\t', '\n', '\v', '\f', '\r', ' '};
owl_wchar OWL_BIN_PATH[] = {'/', '\\', '.'};
owl_wchar OWL_BIN_LETR[] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 
                            'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
                            'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 
                            'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'};
#define OWL_BIN_NULL 0x00

// basic functions
owl_byte owl_check_wchar_bin(owl_wchar ch);
owl_byte owl_check_wchar_enc_bin(owl_byte * src, owl_umax size);
owl_wchar owl_get_wchar_bin(owl_byte * src, owl_umax size);
owl_byte * owl_write_wchar_enc_bin(owl_wchar ch, owl_byte * dest, owl_umax size);
owl_byte owl_print_wchar_bin(owl_wchar ch);
owl_byte owl_print_wchar_enc_bin(owl_byte * src, owl_umax size);
// conversion to unicode
owl_wchar owl_wchar_bin_as_unicode(owl_wchar bin);
owl_wchar owl_wchar_unicode_as_bin(owl_wchar unicode);

#include "bin.c"

#endif // bin_h
